﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Babylon.Toolbox
{
    public class SkinnedEffect : BasicEffect3Lights
    {
        private readonly EffectParameter bonesParameter;

        public SkinnedEffect(GraphicsDevice device)
            : this(device, "Babylon.Toolbox", "Effects/SkinnedEffect/SkinnedEffect")
        {
           
        }

        protected SkinnedEffect(GraphicsDevice device, string assemblyName, string baseName)
            : base(device, assemblyName, baseName)
        {
            bonesParameter = GetParameter("Bones");
        }

        public Matrix[] BonesSkin { get; set; }

        public override void Apply()
        {
            bonesParameter.SetValue(BonesSkin);
            base.Apply();
        }
    }
}
